import 'package:flutter_blog_manage_study/generated/json/base/json_field.dart';
import 'package:flutter_blog_manage_study/generated/json/user_entity.g.dart';
import 'dart:convert';
export 'package:flutter_blog_manage_study/generated/json/user_entity.g.dart';

/// * 作者: Tao
/// * 日期: 2024/3/20
/// * 时间: 16:56
/// * 描述: 用户信息实体类
@JsonSerializable()
class UserEntity {
	late bool admin = false;
	late List<dynamic> chapterTops = [];
	late int coinCount = 0;
	late List<dynamic> collectIds = [];
	late String email = '';
	late String icon = '';
	late int id = 0;
	late String nickname = '';
	late String password = '';
	late String publicName = '';
	late String token = '';
	late int type = 0;
	late String username = '';

	UserEntity();

	factory UserEntity.fromJson(Map<String, dynamic> json) => $UserEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}